import Vue from 'vue';

// 1. 引入vue-router
import VueRouter from 'vue-router'

// 2. vue安装router路由
Vue.use(VueRouter);

import app from './App.vue'

// 导入组件
import user from './components/User.vue'
import goodslist from './components/GoodsList.vue'

// 3. 配置路由
var router = new VueRouter({
    routes: [
        {
            path: '/user', component: user
        },
        {
            path: '/goods', component: goodslist
        }
    ]
});

var vm = new Vue({
    el: "#app",

    render: c => c(app),
    // 挂载路由
    router
});
